package com.yinghuo.risk.frigate.web.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * com.yinghuo.risk.frigate.core.entity
 *
 * @author 白雨浓
 * date: 2018/10/18 14:29
 * content:
 */
@Entity
@Table(name = "cache", schema = "shiro-test", catalog = "")
public class CacheEntity {
    private String key;
    private String value;

    @Id
    @Column(name = "`key`")
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @Basic
    @Column(name = "`value`")
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CacheEntity that = (CacheEntity) o;
        return Objects.equals(key, that.key) &&
                Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value);
    }
}
